Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assimilate rspec questionwriter into fppgen #32

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

nelson-lojo
Copy link
Contributor

@nelson-lojo nelson-lojo commented May 31, 2024

Dependent on #31. Can be marked as "not draft" once that is closed

Added most (if not all) functionality of rspec-questionwriter into fppgen.

  • Put autograder-specific data in ## test ## as yaml. As of now, this includes only the submit_to and mutations YAML fields.
  • The specification of the SUT is referenced by a relative path in the ## setup_code ## region
    • I picked this arbitrarily without much thought, if this is more sensible to include in ## test ##, ## metadata ##, or another region, let me know

Example source file (port of example_question from rspec-questionwriter) is below:
example_question.fpp

"""
This is an example question. Write a test for the even function. 
"""

## prefix_code ##
describe functions do
## prefix_code ##

  it "Even function" do
    ?expect(even(1)).to eq False?
    ?expect(even(2)).to eq True?
  end

## suffix_code ##
end
## suffix_code ##

## metadata ##
{
    "autograder" : "rspec"
}
## metadata ##

## setup_code ##
app/
## setup_code ##

## test ##
submit_to: spec/func_spec.rb # this is where _submission_file will append to when running suites
mutations:
  suite1:
    files:
      funcs.rb: |
        19c19
        <     n % 2 == 0
        ---
        >     !(inc(n) % 2 == 0)
        
## test ##

@nelson-lojo nelson-lojo self-assigned this May 31, 2024
@nelson-lojo nelson-lojo linked an issue May 31, 2024 that may be closed by this pull request
@SybelBlue
Copy link
Contributor

I am going to hold off on review till #31 closes. Meanwhile, before closing, would also like to squash this so we keep the repo history clean

@nelson-lojo
Copy link
Contributor Author

I am going to hold off on review till #31 closes. Meanwhile, before closing, would also like to squash this so we keep the repo history clean

Yes I do agree that this should be a squash merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assimilate rspec-questionwriter into fppGen
2 participants